package com.hello.simple;

import com.Constants;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.io.IOException;
import java.util.Map;

public class Main {
    public static void main(String[] args) throws IOException {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(HelloSimpleMqConfiguration.class);
        Map<String, AmqpTemplate> beans = context.getBeansOfType(AmqpTemplate.class);

        AmqpTemplate template = context.getBean(AmqpTemplate.class);
        template.convertAndSend(Constants.QUEUE_NAME, "simple");
     /*   String msg = (String) template.receiveAndConvert(Constants.QUEUE_NAME);
        System.out.println("msg = " + msg);*/
        context.close();
    }

}
